package com.example.nuc_ms_beta.ui.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;

import com.example.nuc_ms_beta.R;
import com.example.nuc_ms_beta.util.UrlShareUtil;

/**
 * Created by bnhc on 17-6-8.
 * <p>
 * Just for Url Show
 */

public class UrlShowActivity extends Activity implements View.OnClickListener {
    private WebView urljustshowactivity_wb;
    private Button urljustshowactivity_bt;
    private String url;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_justurlshowlayout);
        url = getIntent().getStringExtra("url");
        initView();
    }

    private void initView() {
        urljustshowactivity_wb = (WebView) findViewById(R.id.urljustshowactivity_wb);
        urljustshowactivity_wb.loadUrl(url);
        urljustshowactivity_bt = (Button) findViewById(R.id.urljustshowactivity_bt);
        urljustshowactivity_bt.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.urljustshowactivity_bt:
                UrlShareUtil.showShare(url);
                break;
        }
    }
}
